<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/5/25 0025
 * Time: 17:21
 */

namespace app\common\controller;

use think\Loader;
use think\Controller;
use drunk\file;
use \think\Request;

class Base extends Controller
{
    function _initialize()
    {
        parent::_initialize();
        $functions = file::lists_file(EXTEND_PATH . DS . 'functions', '*.php');
        if (!empty($functions)) foreach ($functions as $file) require_once $file; // 加载快捷函数等
        $this->gateway();
    }

    private function gateway(){
        $request = Request::instance();
        $action = $request->action();
        $controller = $request->controller();
        config([
            "action" => $action,
            "controller" => $controller,
//            'logInfo' => member\LogInfo::get(), // 将登录用户信息缓存到配置中
        ]);
    }
}